A good answer might be:

You will compile the old, uncorrected version of the source file and get the same error message. When you are using Notepad (or any other text editor) you are changing the version of the source program that is in main memory. The compiler javac uses the file that is saved on the hard disk.


Edit, Compile, Run Cycle

This is what you will do until your program is running correctly:

  1. Edit the program using Notepad.
  2. Save the program to the hard disk with the "Save" or "Save As" command in Notepad.
  3. Compile the program with the javac command.
  4. If there are syntax errors, go back to step 1.
  5. Run the program with the java command.
  6. If it does not run correctly, go back to step 1.
  7. When it runs correctly, quit.

This is called the "edit-compile-and-run" cycle. Expect to go through it many times per program. A Java development environment like Symantec Café is more sophisticated but the same fundamental activities are going on underneath.

QUESTION 7:

If a source program compiles correctly in step 3, does that mean that it will run correctly?